package org.huntaway.po.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the module table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="module"
 */

public abstract class BaseModule  implements Serializable {

	public static String REF = "Module";
	public static String PROP_NAME = "Name";
	public static String PROP_PRO = "Pro";
	public static String PROP_UPDATOR = "Updator";
	public static String PROP_INTRODUCTION = "Introduction";
	public static String PROP_CREATOR = "Creator";
	public static String PROP_SYS_MODULE_ID = "SysModuleId";
	public static String PROP_MODULE_ORDER = "ModuleOrder";
	public static String PROP_ID = "Id";
	public static String PROP_UPDATE_DATE = "UpdateDate";
	public static String PROP_REMARK = "Remark";
	public static String PROP_CREATE_DATE = "CreateDate";
	public static String PROP_CODE = "Code";


	// constructors
	public BaseModule () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseModule (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseModule (
		java.lang.Integer id,
		java.lang.String name) {

		this.setId(id);
		this.setName(name);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer sysModuleId;
	private java.lang.String code;
	private java.lang.String name;
	private java.lang.Integer moduleOrder;
	private java.lang.String remark;
	private java.lang.String introduction;
	private java.util.Date createDate;
	private java.util.Date updateDate;
	private java.lang.String creator;
	private java.lang.String updator;

	// many to one
	private org.huntaway.po.Project pro;

	// collections
	private java.util.Set<org.huntaway.po.Modulecolumn> modulecolumns;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: sys_module_id
	 */
	public java.lang.Integer getSysModuleId () {
		return sysModuleId;
	}

	/**
	 * Set the value related to the column: sys_module_id
	 * @param sysModuleId the sys_module_id value
	 */
	public void setSysModuleId (java.lang.Integer sysModuleId) {
		this.sysModuleId = sysModuleId;
	}



	/**
	 * Return the value associated with the column: code
	 */
	public java.lang.String getCode () {
		return code;
	}

	/**
	 * Set the value related to the column: code
	 * @param code the code value
	 */
	public void setCode (java.lang.String code) {
		this.code = code;
	}



	/**
	 * Return the value associated with the column: name
	 */
	public java.lang.String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: name
	 * @param name the name value
	 */
	public void setName (java.lang.String name) {
		this.name = name;
	}



	/**
	 * Return the value associated with the column: module_order
	 */
	public java.lang.Integer getModuleOrder () {
		return moduleOrder;
	}

	/**
	 * Set the value related to the column: module_order
	 * @param moduleOrder the module_order value
	 */
	public void setModuleOrder (java.lang.Integer moduleOrder) {
		this.moduleOrder = moduleOrder;
	}



	/**
	 * Return the value associated with the column: remark
	 */
	public java.lang.String getRemark () {
		return remark;
	}

	/**
	 * Set the value related to the column: remark
	 * @param remark the remark value
	 */
	public void setRemark (java.lang.String remark) {
		this.remark = remark;
	}



	/**
	 * Return the value associated with the column: introduction
	 */
	public java.lang.String getIntroduction () {
		return introduction;
	}

	/**
	 * Set the value related to the column: introduction
	 * @param introduction the introduction value
	 */
	public void setIntroduction (java.lang.String introduction) {
		this.introduction = introduction;
	}



	/**
	 * Return the value associated with the column: create_date
	 */
	public java.util.Date getCreateDate () {
		return createDate;
	}

	/**
	 * Set the value related to the column: create_date
	 * @param createDate the create_date value
	 */
	public void setCreateDate (java.util.Date createDate) {
		this.createDate = createDate;
	}



	/**
	 * Return the value associated with the column: update_date
	 */
	public java.util.Date getUpdateDate () {
		return updateDate;
	}

	/**
	 * Set the value related to the column: update_date
	 * @param updateDate the update_date value
	 */
	public void setUpdateDate (java.util.Date updateDate) {
		this.updateDate = updateDate;
	}



	/**
	 * Return the value associated with the column: creator
	 */
	public java.lang.String getCreator () {
		return creator;
	}

	/**
	 * Set the value related to the column: creator
	 * @param creator the creator value
	 */
	public void setCreator (java.lang.String creator) {
		this.creator = creator;
	}



	/**
	 * Return the value associated with the column: updator
	 */
	public java.lang.String getUpdator () {
		return updator;
	}

	/**
	 * Set the value related to the column: updator
	 * @param updator the updator value
	 */
	public void setUpdator (java.lang.String updator) {
		this.updator = updator;
	}



	/**
	 * Return the value associated with the column: pro_id
	 */
	public org.huntaway.po.Project getPro () {
		return pro;
	}

	/**
	 * Set the value related to the column: pro_id
	 * @param pro the pro_id value
	 */
	public void setPro (org.huntaway.po.Project pro) {
		this.pro = pro;
	}



	/**
	 * Return the value associated with the column: Modulecolumns
	 */
	public java.util.Set<org.huntaway.po.Modulecolumn> getModulecolumns () {
		return modulecolumns;
	}

	/**
	 * Set the value related to the column: Modulecolumns
	 * @param modulecolumns the Modulecolumns value
	 */
	public void setModulecolumns (java.util.Set<org.huntaway.po.Modulecolumn> modulecolumns) {
		this.modulecolumns = modulecolumns;
	}

	public void addToModulecolumns (org.huntaway.po.Modulecolumn modulecolumn) {
		if (null == getModulecolumns()) setModulecolumns(new java.util.TreeSet<org.huntaway.po.Modulecolumn>());
		getModulecolumns().add(modulecolumn);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.huntaway.po.Module)) return false;
		else {
			org.huntaway.po.Module module = (org.huntaway.po.Module) obj;
			if (null == this.getId() || null == module.getId()) return false;
			else return (this.getId().equals(module.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}